﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "IFamilySketchCurve.h"
#include "GmFamilyService.h"
namespace gcmp
{
    class IGraphicsPlaneCurve;
    class GCurve2d;
}

namespace gfam
{
    /// \brief 2D草图曲线
    class GM_FAMILY_SERVICE_EXPORT IFamily2DSketchCurve : public IFamilySketchCurve
    {
        DEFINE_CAST_DERIVED(gfam::IFamily2DSketchCurve, gfam::IFamilySketchCurve)
    public:

        /// \brief 获取2D曲线
        ///
        /// \return 2D曲线
        virtual gcmp::GCurve2d* GetGCurve2dFW() = 0;

        /// \brief 获取2D曲线
        ///
        /// \return 2D曲线
        virtual const gcmp::GCurve2d* GetGCurve2d() const = 0;

        /// \brief 设置2D曲线
        ///
        /// \param curve2d 2D曲线
        virtual void SetGCurve2d(gcmp::OwnerPtr<gcmp::GCurve2d> curve2d) = 0;

        /// \brief 创建约束符号
        ///
        /// \param pModelView 视图
        virtual void CreateConstraintSymbol(gcmp::IModelView* pModelView = nullptr) const = 0;

        /// \brief 曲线反向
        virtual void Reverse() = 0;

        /// \brief 设置草图平面id
        ///
        /// \param idSketchPlane 草图平面id
        virtual void SetSketchPlaneId(const gcmp::ElementId&idSketchPlane) = 0;
        /// \brief 获取草图平面id
        ///
        /// \return 草图平面id
        virtual gcmp::ElementId GetSketchPlaneId() const = 0;


        /// \brief 获取平面曲线，约束解算时使用
        ///
        /// \return 平面曲线
        virtual const gcmp::IGraphicsPlaneCurve* GetGPlaneCurve() const = 0;
        /// \brief 获取平面曲线，约束解算时使用
        ///
        /// \return 平面曲线
        virtual gcmp::IGraphicsPlaneCurve* GetGPlaneCurveFW() = 0;

        /// \brief 设置平面曲线
        ///
        /// \param planeCurve 平面曲线
        virtual void SetGPlaneCurve(gcmp::OwnerPtr<gcmp::IGraphicsPlaneCurve> planeCurve) = 0;


        /// \brief 获取坡度线id
        ///
        /// \return 坡度线id
        virtual gcmp::ElementId GetSlopeLineId() const = 0;

        /// \brief 设置坡度线id
        ///
        /// \param slopeLineId坡度线id
        virtual void SetSlopeLineId(const gcmp::ElementId& slopeLineId) = 0;

        /// \brief 获取是否设置坡度线的关联更新id
        ///
        /// \return 是否设置坡度线的关联更新id
        virtual RegenDataId GetIsDefineSlopeRdId() const = 0;


        /// \brief 获取ImplementationUid
        /// 
        /// \return ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();


        // TODO 
        virtual void SetGCurve2dAsString() = 0;

        virtual RegenDataId GetGCurve2dAsStringRdId() const = 0;

    };
}